package actions;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import views.FileView;


public class ShowFileViewAction extends Action {
    private IWorkbenchWindow window;
	
	
	public ShowFileViewAction(IWorkbenchWindow window)
	{
		this.window=window;
		this.setText("Bpel Project Sample ");
		
		
	}
	public void run()
	{
		if(window != null) {	
			try {
				window.getActivePage().showView(FileView.ID);
			} catch (PartInitException e) {
				MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
			}
		}
	}

}
